package com.example.sky.controller;

import com.alibaba.fastjson.JSON;
import com.example.sky.entity.Hello;
import com.example.sky.service.impl.HelloServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
public class HelloController {

    @Autowired
    private HelloServiceImpl helloService;

    @GetMapping("/hello")
    public List<Hello> Hello(@RequestParam(defaultValue = "1") int pageNo, @RequestParam(defaultValue = "10") int pageSize) {
        List<Hello> hellos = helloService.findByPage(pageNo, pageSize);
        return hellos;
}

    @GetMapping("/hi")
    public String Hi() {
        return "hello111111111";
    }
}
